﻿namespace JelloPhysics
{
    using System;
    using System.Runtime.InteropServices;

    [StructLayout(LayoutKind.Sequential)]
    public struct Bitmask
    {
        public int mask;
        public void clear()
        {
            this.mask = 0;
        }

        public void setOn(int bit)
        {
            this.mask |= ((int) 1) << ((bit > 0) ? (bit - 1) : 0);
        }

        public void setOff(int bit)
        {
            this.mask &= ~(((int) 1) << ((bit > 0) ? (bit - 1) : 0));
        }
    }
}

